<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<head>
    <meta charset="utf-8" />
    <title>祈贝健康--后台管理系统</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" />
    <meta content="" name="description" />
    <meta content="" name="author" />

    <!-- ================== BEGIN BASE CSS STYLE ================== -->
    <link href="./Public/Admin/assets/plugins/jquery-ui/themes/base/minified/jquery-ui.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/css/animate.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/css/style.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/css/style-responsive.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/css/theme/default.css" rel="stylesheet" id="theme" />
    <!-- ================== END BASE CSS STYLE ================== -->

    <!-- ================== BEGIN PAGE LEVEL STYLE ================== -->
    <link href="./Public/Admin/assets/plugins/DataTables/css/data-table.css" rel="stylesheet" />
    <!-- ================== END PAGE LEVEL STYLE ================== -->

    <!-- ================== BEGIN BASE JS ================== -->
    <script src="./Public/Admin/assets/plugins/pace/pace.min.js"></script>

    <!-- ================== END BASE JS ================== -->

    <style>
        .date-form{
            background:url("./Public/Admin/laydate/laydate-master/skins/default/icon.png") no-repeat right ;

        }
    </style>
</head>
<body>
<php>include './Public/Admin/header.html'; </php>


<!-- begin #content -->
<div id="content" class="content">
    <!-- begin breadcrumb -->
    <ol class="breadcrumb pull-right">
        <li><a href="javascript:;">首页</a></li>
        <li><a href="javascript:;">推广管理</a></li>
        <li class="active">管理列表</li>
    </ol>
    <h1 class="page-header">推广管理 <small>管理列表</small></h1>
    <!-- end page-header -->

    <!-- begin row -->
    <div class="row">
        <!-- begin col-12 -->
        <div class="col-md-12">
            <!-- begin panel -->
            <div class="panel panel-inverse" >
                <div class="panel-heading">
                    <div class="panel-heading-btn">
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-repeat"></i></a>
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-danger" data-click="panel-remove"><i class="fa fa-times"></i></a>
                    </div>
                    <h4 class="panel-title">推广信息</h4>
                </div>

                <div class="panel-body" >
                    <div class="row">
                        <div class="col-sm-1">
                            <!-- Small button group -->
                            <div class="btn-group">
                                <h4 class="text-center"><strong>历史统计</strong></h4>
                            </div>
                        </div>
                        <div class="col-sm-2">
                              <input type='text' class='form-control date-form' name="date"  id="J-x6" value=""/>
                        </div>
                        <div class="col-sm-2">
                            <input type='text' class='form-control date-form' name="date"  id="J-x8"/>
                        </div>

                        <div class="col-sm-2">
                            <select  onchange="loads()"  id="data_code" class="form-control">

                            </select>
                        </div>

                        <div class="col-sm-1">
                            <button id="reload">查询</button>
                        </div>

                        
                        <div  class="col-sm-1">
                          <button   id="print_data">打印</button>
                            <!--<a href="javascript:;" class="btn btn-primary btn-md" onclick="return doSomeAction()">执行</a>-->
                        </div>

                    </div>
                    <div class="table-responsive" >
                        <table id="data-table" class="table table-striped table-bordered">

                        </table>
                    </div>
                </div>
            </div>
            <!-- end panel -->
        </div>
        <!-- end col-12 -->
    </div>
    <!-- end row -->
</div>
<!-- end #content -->

<!-- begin scroll to top btn -->
<a href="javascript:;" class="btn btn-icon btn-circle btn-success btn-scroll-to-top fade" data-click="scroll-top"><i class="fa fa-angle-up"></i></a>
<!-- end scroll to top btn -->
</div>
<!-- end page container -->

<!-- ================== BEGIN BASE JS ================== -->
<script src="./Public/Admin/assets/plugins/jquery/jquery-1.9.1.min.js"></script>
<script src="./Public/Admin/assets/plugins/jquery/jquery-migrate-1.1.0.min.js"></script>
<script src="./Public/Admin/assets/plugins/jquery-ui/ui/minified/jquery-ui.min.js"></script>
<script src="./Public/Admin/assets/plugins/bootstrap/js/bootstrap.min.js"></script>
<!--[if lt IE 9]>
<script src="./Public/Admin/assets/crossbrowserjs/html5shiv.js"></script>
<script src="./Public/Admin/assets/crossbrowserjs/respond.min.js"></script>
<script src="./Public/Admin/assets/crossbrowserjs/excanvas.min.js"></script>
<![endif]-->
<script src="./Public/Admin/assets/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<!-- ================== END BASE JS ================== -->
<!-- ================== BEGIN PAGE LEVEL JS ================== -->
<script src="./Public/Admin/assets/plugins/DataTables/js/jquery.dataTables.js"></script>
<script src="./Public/Admin/assets/plugins/DataTables/js/dataTables.colVis.js"></script>
<script src="./Public/Admin/assets/js/apps.min.js"></script>
<script src="./Public/Admin/laydate/laydate-master/laydate.dev.js"></script>
<!-- ================== END PAGE LEVEL JS ================== -->
<script>





    $(document).ready(function() {
        App.init();
        $.getJSON("index.php?m=Admin&c=AD&a=code_list",function(result){
            var html='<option value="-1">全部二维码</option>';
            if(result!=0){
                $.each(result, function(key, val) {
                    html+='<option value="'+val+'">'+val+'  二维码</option>';
                });
            }
            $("#data_code").html(html);

        });
        //实例化日期插件
        laydate({
            elem: '#J-x6'
        });
        laydate({
            elem: '#J-x8'
        });



        var table= $('#data-table').DataTable({
            "dom": 'tiprl',
            "columnDefs": [
                {
                    "targets": 0,
                    sTitle:'ID',
                    "data": "id"
                },
                {
                    "targets": 1,
                    sTitle:'IP地址',
                    "data": "ips"
                },

                {
                    "targets": 2,
                    sTitle:'二维码名称',

                    "data": "qrcode"
                },
                {
                    "targets": 3,
                    sTitle:'扫码时间',
                    "data": "s_time"
                }
            ],

            "oLanguage": {
                "sLengthMenu": "每页显示 _MENU_ 条记录",
                "sProcessing": "努力加载数据中.",
                "sZeroRecords": "抱歉， 没有找到",
                "sInfo": "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
                "sInfoEmpty": "没有数据",
                "sInfoFiltered": "(从 _MAX_ 条数据中检索)",
                "oPaginate": {
                    "sFirst": "首页",
                    "sPrevious": "上一页",
                    "sNext": "下一页",
                    "sLast": "尾页"
                }
            },
            "sPaginationType": "full_numbers",
            "bProcessing": true,
            "bServerSide": false,
            "searching":false,
            "bSort":false,
            "bFilter": true,
            "sAjaxSource": "index.php?m=Admin&c=AD&a=scancode",

            "fnServerParams": function (aoData) {

                aoData.push(
                        {"name": "data_code", "value": $("#data_code").val()},
                        {"name": "data_time_one", "value": $('#J-x6').val()},
                        {"name": "data_time_two", "value": $('#J-x8').val()}
                )
            },

            "deferRender": true,//处理大数据时延迟渲染数据
        });
        //刷新重新加载数据

          $("#reload").click(function(){
              table.ajax.reload();
              table.page( 2).draw( false );
        });
    });
</script>
<script>
      

    var code,time;
    //data_code 二维码类型
    function loads(){
        code=$("#data_code").find("option:selected").val();
    }

    var time_one= $('#J-x6').val();
    var time_two= $('#J-x8').val();
     $("#print_data").click(function(){
        window.location.href="index.php?m=Admin&c=AD&a=pushs&data_time_one="+time_one+"&data_time_two="+time_two+"&code="+code; 
     });


</script>
</body>
</html>

